import Router from 'koa-router';
import {login, logout, register} from "../controller/index.js";
import {alreadyUser, handlePassword, verifyUser} from "../middleware/index.js";

const routes = new Router({prefix: '/auth'})

routes.post('/register', verifyUser, alreadyUser, handlePassword, register)

routes.post('/login', verifyUser, handlePassword, login)

routes.post('/logout', logout)

export default routes
